package com.qf.qfusermanager.web.controller;

import com.qf.common.bean.Pages;
import com.qf.common.bean.R;
import com.qf.common.dto.AreaDto;
import com.qf.qfusermanager.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/area")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @PostMapping("/list")
    public R list(@RequestBody(required = false) AreaDto areaDto){

        //返回的r对象中的data应该是一个Page对象（除了结果集数据外还要有分页参数）
        R r = areaService.list(areaDto);

        return r;
    }
}
